Getting started

CHICKEN is a compiler that translates Scheme source files into C, which in turn can be fed to a C compiler to generate a standalone executable. An interpreter is also available and can be used as a scripting environment or for testing programs before compilation.

This chapter is designed to get you started with CHICKEN programming, describing what it is and what it will do for you, and covering basic use of the system. With almost everything discussed here, there is more to the story, which the remainder of the manual reveals. Here, we only cover enough to get you started. Nonetheless, someone who knows Scheme already should be able to use this chapter as the basis for writing and running small CHICKEN programs.

Scheme

Scheme is a member of the Lisp family of languages, of which Common Lisp and Emacs Lisp are the other two widely-known members. As with Lisp dialects, Scheme features

In contrast to Common Lisp, Scheme is very minimal, and tries to include only those features absolutely necessary in programming. In contrast to Emacs Lisp, Scheme is not anchored into any one program (Emacs), and has a somewhat more modern language design.

Scheme is defined in a document called The Revised^5 Report on the Algorithmic Language Scheme, or R5RS for short. (Yes, it really has been revised five times, so an expanded version of its name would be The Revised Revised Revised Revised Revised Report.) A newer report, R6RS, was released in 2007, but this report has attracted considerable controversy, and not all Scheme implementations will be made compliant with it. CHICKEN essentially complies with R5RS.

Even though Scheme is consciously minimalist, it is recognized that a language must be more than a minimal core in order to be useful. Accordingly, the Scheme community uses a process known as `Scheme Requests For Implementation' (SRFI, pronounced `SUR-fee') to define new language features. A typical Scheme system therefore complies with one of the Scheme reports plus some or all of the accepted SRFIs.

A good starting point for Scheme knowledge is http://www.schemers.org. There you will find the defining reports, FAQs, lists of useful books and other resources, and the SRFIs.

The CHICKEN community is at present developing tutorials for programmers who are new to Scheme but experienced with Python, Ruby, or other languages. These can be found on the CHICKEN wiki.

CHICKEN

CHICKEN is an implementation of Scheme that has many advantages.

CHICKEN Scheme combines an optimising compiler with a reasonably fast interpreter. It supports almost all of R5RS and the important SRFIs. The compiler generates portable C code that supports tail recursion, first-class continuations, and lightweight threads, and the interface to and from C libraries is flexible, efficient, and easy to use. There are hundreds of contributed CHICKEN libraries that make the programmer's task easier. The interpreter allows interactive use, fast prototyping, debugging, and scripting. The active and helpful CHICKEN community fixes bugs and provides support. Extensive documentation is supplied.

CHICKEN was developed by Felix L. Winkelmann over the period from 2000 through 2007. In early 2008, Felix asked the community to take over the responsibility of developing and maintaining the system, though he still takes a strong interest in it, and participates actively.

CHICKEN includes

This package is distributed under the BSD license and as such is free to use and modify.

Scheme cognoscenti will appreciate the method of compilation and the design of the runtime-system, which follow closely Henry Baker's CONS Should Not CONS Its Arguments, Part II: Cheney on the M.T.A. paper and expose a number of interesting properties.

The generated C code is fully tail-recursive.

Some of the features supported by CHICKEN:

CHICKEN has been used in many environments ranging from embedded systems through desktop machines to large-scale server deployments. The number of language extensions, or eggs, is constantly growing.

CHICKEN is supported by SWIG (Simplified Wrapper and Interface Generator), a tool that produces quick-and-dirty interface modules for C libraries (http://www.swig.org).

This chapter provides you with an overview of the entire system, with enough information to get started writing and running small Scheme programs.

CHICKEN repositories, websites, and community

The master CHICKEN website is http://www.call-with-current-continuation.org. Here you can find basic information about CHICKEN, downloads, and pointers to other key resources.

The CHICKEN wiki (http://wiki.call-cc.org) contains the most current version of the User's manual, along with various tutorials and other useful documents. The list of eggs is at http://wiki.call-cc.org/chicken-projects/egg-index-4.html#category-list.

A very useful search facility for questions about CHICKEN is found at http://chickadee.call-cc.org. The CHICKEN issue tracker is at http://bugs.call-cc.org.

The CHICKEN community has two major mailing lists. If you are a CHICKEN user, chicken-users (http://lists.nongnu.org/mailman/listinfo/chicken-users) will be of interest. The crew working on the CHICKEN system itself uses the very low-volume chicken-hackers list (http://lists.nongnu.org/mailman/listinfo/chicken-hackers) for communication.

Installing CHICKEN

CHICKEN is available in binary form for Windows and Linux/x86 systems, and in source form for all other platforms. Refer to the README file in the distribution for instructions on installing it on your system.

Because it compiles to C, CHICKEN requires that a C compiler be installed on your system. (If you're not writing embedded C code, you can pretty much ignore the C compiler once you have installed it.)

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se http://wiki.call-cc.org/platformsicklys can be used in cmd.exe with the version of make that comes with mingw. Makefile.mingw-msys uses unix commands such as cp and rm. The end product is the same.

Refer to the README file for the version you're installing for more information on the installation process.

Alternatively, third party packages in binary format are available. Se